CUBE CONNECT Edition Help

Examples and FAQ

This section contains examples of the Generation program, along with a link to the Voyager FAQ chapter.

Example 1

RUN PGM=GENERATION
ID=DEMO TRIP GENERATION
pagewidth=80
zones=19
zdati[1]=c:\demo\demo08.dat,z=#2,select=1-1,
hh1=#3,hh2=#4,hh3=#5,hh4=#6,hh5=#7,hh6=#8,hh7=#9,
hh8=10,hh9=11,hh10=12,hh11=#13,hh12=#14,hh13=#15
zdati[2]=c:\demo\demo08.dat,z=#2, select=2-1, emp1=3,emp2=4
zdati[3]=c:\demo\demo08.dat,z=2-4,select=3-1, p3a=21-25,p4a=31-35
zdati[4]=c:\demo\demo08.dat,z=2-4,select=4-1, xicnt=6-10,ixcnt=11-15
report zdat=y
tothh = zi.1.hh1 + zi.1.hh2 + zi.1.hh3 + zi.1.hh4 + zi.1.hh5 + zi.1.hh6 +
zi.1.hh7 + zi.1.hh8 + zi.1.hh9 + zi.1.hh10 + zi.1.hh11 + zi.1.hh12 + zi.1.hh13
totemp = zi.2.emp1 + zi.2.emp2
phbw = .21 * 4.5 * zi.1.hh1 + .21 * 6.8 * zi.1.hh2 +
.18 * 8.4 * zi.1.hh3 +
.18 * 10.2 * zi.1.hh4 + .18 * 11.9 * zi.1.hh5 +
.16 * 13.2 * zi.1.hh6 + .16 * 14.4 * zi.1.hh7 +
.16 * 15.1 * zi.1.hh8 + .15 * 16.4 * zi.1.hh9 +
.14 * 17.7 * zi.1.hh10 + .13 * 18.0 * zi.1.hh11 +
.13 * 19.0 * zi.1.hh12 + .13 * 19.2 * zi.1.hh13
phbo = .57 * 4.5 * zi.1.hh1 + .57 * 6.8 * zi.1.hh2 +
.57 * 8.4 * zi.1.hh3 + .59 * 10.2 * zi.1.hh4 +
.59 * 11.9 * zi.1.hh5 + .61 * 13.2 * zi.1.hh6 +
.61 * 14.4 * zi.1.hh7 + .68 * 15.1 * zi.1.hh8 +
.62 * 16.4 * zi.1.hh9 + .62 * 17.7 * zi.1.hh10 +
.62 * 18.0 * zi.1.hh11 + .62 * 19.0 * zi.1.hh12 +
.62 * 19.2 * zi.1.hh13
pnhb = .22 * 4.5 * zi.1.hh1 + .22 * 6.8 * zi.1.hh2 +
.22 * 8.4 * zi.1.hh3 + .23 * 10.2 * zi.1.hh4 +
.23 * 11.9 * zi.1.hh5 + .23 * 13.2 * zi.1.hh6 +
.23 * 14.4 * zi.1.hh7 + .23 * 15.1 * zi.1.hh8 +
.23 * 16.4 * zi.1.hh9 + .24 * 17.7 * zi.1.hh10 +
.25 * 18.0 * zi.1.hh11 + .25 * 19.0 * zi.1.hh12 +
.25 * 19.2 * zi.1.hh13
pix = 0.03 * 1.03 * (phbw+phbo+pnhb)
pxi = zi.4.xicnt
ahbw = 1.81 * ( 1.7 * totemp)
ahbo = 1.90 * (10.0 * zi.2.emp1 + 0.5 * zi.2.emp2 + tothh)
anhb = 1.49 * ( 2.0 * zi.2.emp1 + 2.5 * zi.2.emp2 + 0.5*tothh)
axi = 0.08*ahbw + 0.10*ahbo + 0.03*anhb
aix = zi.4.ixcnt
p[1]=phbw, p[2]=phbo, p[3]=pnhb, p[4]=pix, p[5]=pxi
a[1]=0.92*ahbw a[2]=0.90*ahbo a[3]=0.97*anhb a[4]=aix, a[5]=axi
phase=adjust
a[1] = p[1][0] / a[1][0] * a[1]
a[2] = p[2][0] / a[2][0] * a[2]
a[3] = p[3][0] / a[3][0] * a[3]
p[3] = a[3]
a[4] = p[4][0] / a[4][0] * a[4]
p[5] = a[5][0] / p[5][0] * p[5]
pao=out.dat,form=8.0 list=z(2),p[1],p[2],p[3],p[4],p[5],a[1],a[2],a[3],a[4],a[5]
ENDRUN

Example 2

RUN PGM=GENERATION
FILEI ZDATI[1]=zonedata.dbf ; dbf data structure is Z, V1, V2,...., V254
FILEI ZDATI[2]=zonedata.dbf ; External PA file. dbf data structure is Z,
                            ; Xprod1,Xprod2,Xprod3,Xattr1,Xattr2,Xattr3
for example
                            ; These fields could also be fields on your zone data file
FILEO PAO[1] = "TRIPENDS.DBF",
                FORM=6.0, DBF=T, LIST=Z, P[1] P[2] P[3] A[1] A[2] A[3]
; lets say system has 1000 zones with 901-1000 being the externals
; and we have 3 trip purposes
PARAMETERS ZONES=1000
PROCESS PHASE=ILOOP
; define trip rates by purposes
; purpose = home based
hbp_p = 0.2         ; production trip rate per person (population) per day
hbp_ia = 0.5        ; production trip rate per industry/agricultural worker per day
hbp_s = 0.6         ; production trip rate per service worker per day
hbp_r = 40.0        ; production trip rate per retail worker per day (incl shoppers)
hbp_sc = 0.1        ; production trip rate per pupil/student per day
hba_p = 1.8         ; attraction trip rate per person (population) per day
hba_ia = 0.6        ; attraction trip rate per industry/agricultural worker per
hba_s = 0.6         ; production trip rate per service worker per day
hba_r = 45.0        ; production trip rate per retail worker per day (incl shoppers)
hba_sc = 0.1        ; production trip rate per pupil/student per day
; purpose = non-home based
nhbp_p = 1.5        ; production trip rate per person (population) per day
nhbp_ia = 0.3       ; production trip rate per industry/agricultural worker per day
nhbp_s = 0.25       ; production trip rate per service worker per day
nhbp_r = 12         ; production trip rate per retail worker per day (incl shoppers)
nhbp_sc = 0.1       ; production trip rate per pupil/student per day
nhba_p = 1.3        ; attraction trip rate per person (population) per day
nhba_ia = 0.3       ; attraction trip rate per industry/agricultural worker per day
nhba_s = 0.3        ; attraction trip rate per service worker per day
nhba_r = 14.0       ; attraction trip rate per retail worker per day (incl shoppers)
nhba_sc = 0.1       ; attraction trip rate per pupil/student per day
; purpose = school
schp_p = 0.15       ; production trip rate per person (population) per day
schp_ia = 0         ; production trip rate per industry/agricultural worker per day
schp_s = 0.005      ; production trip rate per service worker per day
schp_r = 0.005      ; production trip rate per retail worker per day
schp_sc = 0.95      ; production trip rate per pupil/student per day
scha_p = 0.15       ; attraction trip rate per person (population) per day
scha_ia = 0         ; attraction trip rate per industry/agricultural worker per day
scha_s = 0.005      ; attraction trip rate per service worker per day
scha_r = 0.005      ; attraction trip rate per retail worker per day
scha_sc = 0.95      ; attraction trip rate per pupil/student per day
IF (I<=900) ; define P/A functions for internal zones
    ; ----- calculate productions per day by purpose
    ; zi.1.vnames are just the filed names in the dbf file
P[1] = (hbp_p*zi.1.pop_2002 + hbp_ia*zi.1.inag_2002 +
  hbp_s*zi.1.serv_2002 +
    hbp_r*zi.1.ret_2002 + hbp_sc*zi.1.sch_2002)
P[2] = (nhbp_p*zi.1.pop_2002+ nhbp_ia*zi.1.inag_2002+
  nhbp_s*zi.1.serv_2002+
    nhbp_r*zi.1.ret_2002+ nhbp_sc*zi.1.sch_2002)
P[3] = (schp_p*zi.1.pop_2002+ schp_ia*zi.1.inag_2002+
  schp_s*zi.1.serv_2002+
    schp_r*zi.1.ret_2002+ schp_sc*zi.1.sch_2002)
    ; ----- calculate attractions per day by purpose
    ; zi.1.vnames are just the filed names in the dbf file
A[1] = (hba_p*zi.1.pop_2002 + hba_ia*zi.1.inag_2002 +
  hba_s*zi.1.serv_2002 +
    hba_r*zi.1.ret_2002 + hba_sc*zi.1.sch_2002)
A[2] = (nhba_p*zi.1.pop_2002+ nhba_ia*zi.1.inag_2002+
  nhba_s*zi.1.serv_2002+
    nhba_r*zi.1.ret_2002+ nhba_sc*zi.1.sch_2002)
A[3] = (scha_p*zi.1.pop_2002+ scha_ia*zi.1.inag_2002+
  scha_s*zi.1.serv_2002+
    scha_r*zi.1.ret_2002+ scha_sc*zi.1.sch_2002)
ELSE ; define P/A for external zones
P[1]=zi.2.Xprod1
P[2]=zi.2.Xprod2
P[3]=zi.2.Xprod3
A[1]=zi.2.Xattr1
A[2]=zi.2.Xattr2
A[3]=zi.2.Xattr3
ENDIF
PROCESS  PHASE=ADJUST
; adjust zonal attractions so total attractions match total productions
    BALANCE A2P=1,3 NHB=2 ; balance attrs to prods for purposes 1, 3
                          ; prods set to attrs for purpose 2
ENDPHASE
ENDRUN

Frequently asked questions

Please see FAQ - Generation in Frequently Asked Questions.